﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Day0320_练习
{
    public struct XYPiont
    {
        public double x;
        public double y;

        public XYPiont(double a, double b)
        {
            x = a;
            y = b;
        }
    }

    class Rectangle
    {
        private double width;
        public double Width
        {
            get { return width; }
            set { width = value; }
        }

        private double height;
        public double Height
        {
            get { return height; }
            set { height = value; }
        }

        private XYPiont point;
        public XYPiont Point
        {
            get { return point; }
            set { point = value; }
        }

        private XYPiont center;
        public XYPiont Center
        {
            get { return center; }
            set { center = value; }
        }

        public Rectangle(double width, double height, XYPiont point, XYPiont center)
        {
            this.Width = width;
            this.Height = height;
            this.Point = point;
            this.Center = center;
        }

        public void Cal(out double lengthZhCH, out double area)
        {
            area = Width * Height;
            lengthZhCH = 2 * (Width + Height);
        }

        public double ZhangChang(out double area)
        {
            area = Width * Height;
            return 2 * (Width + Height);
        }
    }
}
